package com.njworkorder.HTSingleLogin;


import cn.microvideo.qsc.client.api.QsApi;
import cn.microvideo.qsc.client.entity.Role;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * qs客户端工具
 *
 * @author ht_lzc
 * @date 2025/1/3 16:02
 */
@Component
@Slf4j
public class QsClientUtil {
    private static String path;
    private static String qsSecret;
    @Value("${qs.serverUrl}")
    public  void setPath(String path) {
        QsClientUtil.path = path;
    }
    @Value("${qs.secretKey}")
    public  void setQsSecret(String qsSecret) {
        QsClientUtil.qsSecret = qsSecret;
    }

    public static void  init(){
        log.info("path==={}",path);
        log.info("qsSecret==={}",qsSecret);
        QsApi api = QsApi.getApi();
        api.init(path,qsSecret);
        List<Role> roles = api.getRoleByParentId("yh-kjdq");
        log.info("roles==={}",roles);
    }

}
